using Admin.NET.Core;
using MOKA.TPM.Application.Enum;
using MOKA.TPM.Entity;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （非采物料）
/// </summary>
public class PartsOutput : Parts
{
    /// <summary>
    /// 公司代码 （字典名称）
    /// </summary>
    public string? CompanyName { get; set; }

    /// <summary>
    /// 管理分类 （字典名称）
    /// </summary>
    public string? ManaCategoryName { get; set; }

    /// <summary>
    /// 物料费用类别 （字典名称）
    /// </summary>
    public string? PartExpenseTypeName { get; set; }

    /// <summary>
    /// 仓位类型 （字典名称）
    /// </summary>
    public string? PositionName { get; set; }

    /// <summary>
    /// TPM设备分组 （字典名称）
    /// </summary>
    public string? TPMDeviceGroupName { get; set; }

    /// <summary>
    /// 非采类别 （字典名称）
    /// </summary>
    public string? TPMCategoryName { get; set; }

    /// <summary>
    /// 品牌 （字典名称）
    /// </summary>
    public string? BrandName { get; set; }

    /// <summary>
    /// 单位 （字典名称）
    /// </summary>
    public string? UnitName { get; set; }

    public string PartNo { get; set; } //唯一索引

    /// <summary>
    /// 关联对象等
    /// </summary>
    //public string? WePartyLevelName { get; set; }
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class PartsInput
{
    /// <summary>
    /// </summary>
    public Guid? Id { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    public string? PartNo { get; set; }  //唯一索引
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetPartsInput : BaseOrderInput
{
    /// <summary>
    /// 非采类别
    /// </summary>
    public Guid? TPMCategoryId { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    public string? PartNo { get; set; }  //唯一索引

    public TpmStatusEnum? Status { get; set; }
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PagePartsInput : BasePageInput
{
    /// <summary>
    /// 物料编号
    /// </summary>
    public string? PartNo { get; set; }  //唯一索引
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddPartsInput
{
    /// <summary>
    /// 公司代码
    /// </summary>
    public Guid CompanyCode { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    [Required, MaxLength(50)]
    public string PartNo { get; set; } = string.Empty;

    /// <summary>
    /// 物料名称
    /// </summary>
    [Required, MaxLength(200)]
    public string PartName { get; set; } = string.Empty;

    /// <summary>
    /// 物料名称2
    /// </summary>
    [MaxLength(50)]
    public string? PartAlternativeName { get; set; }

    /// <summary>
    /// 管理编号
    /// </summary>
    [MaxLength(20)]
    public string? ManageNo { get; set; }

    /// <summary>
    /// 管理分类
    /// </summary>
    public Guid? ManaCategory { get; set; }

    /// <summary>
    /// 物料费用类别
    /// </summary>
    public Guid? PartExpenseType { get; set; }

    /// <summary>
    /// 仓位类型
    /// </summary>
    public Guid? Position { get; set; }

    /// <summary>
    /// TPM设备分组
    /// </summary>
    public Guid TPMDeviceGroupId { get; set; }

    /// <summary>
    /// 非采类别
    /// </summary>
    public Guid TPMCategoryId { get; set; }

    /// <summary>
    /// 品牌
    /// </summary>
    public Guid? Brand { get; set; }

    /// <summary>
    /// 型号
    /// </summary>
    [MaxLength(50)]
    public string? Model { get; set; }

    /// <summary>
    /// 供应商名称
    /// </summary>
    [MaxLength(100)]
    public string? Supplier { get; set; }

    /// <summary>
    /// 单位
    /// </summary>
    public Guid Unit { get; set; }

    /// <summary>
    /// 参考单价
    /// </summary>
    public decimal? Price { get; set; }

    /// <summary>
    /// 最低库存
    /// </summary>
    public int? LowNum { get; set; }

    /// <summary>
    /// 最高库存
    /// </summary>
    public int? MaxNum { get; set; }

    /// <summary>
    /// 使用周期
    /// </summary>
    public decimal? UseCycle { get; set; }

    /// <summary>
    /// 采购周期
    /// </summary>
    public decimal? ProcurementCycle { get; set; }

    /// <summary>
    /// 图片
    /// </summary>
    public string Picture { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// SAP创建时间
    /// </summary>
    public DateTime? CreateTimeInSAP { get; set; }

    /// <summary>
    /// SAP更新时间
    /// </summary>
    public DateTime? UpdateTimeInSAP { get; set; }

    /// <summary>
    /// SAP同步时间
    /// </summary>
    public DateTime? SyncTime { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [Required, MaxLength(20)]
    public string CreateUser { get; set; } = string.Empty;

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 子表：非采物料参数
    /// </summary>
    public List<PartsParas> PartsParases { get; set; }//一对多
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdatePartsInput
{
    /// <summary>
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 公司代码
    /// </summary>
    public Guid CompanyCode { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    [MaxLength(50)]
    public string PartNo { get; set; }

    /// <summary>
    /// 物料名称
    /// </summary>
    [MaxLength(200)]
    public string PartName { get; set; }

    /// <summary>
    /// 物料名称2
    /// </summary>
    [MaxLength(50)]
    public string? PartAlternativeName { get; set; }

    /// <summary>
    /// 管理编号
    /// </summary>
    [MaxLength(20)]
    public string? ManageNo { get; set; }

    /// <summary>
    /// 管理分类
    /// </summary>
    public Guid? ManaCategory { get; set; }

    /// <summary>
    /// 物料费用类别
    /// </summary>
    public Guid? PartExpenseType { get; set; }

    /// <summary>
    /// 仓位类型
    /// </summary>
    public Guid? Position { get; set; }

    /// <summary>
    /// TPM设备分组
    /// </summary>
    public Guid TPMDeviceGroupId { get; set; }

    /// <summary>
    /// 非采类别
    /// </summary>
    public Guid TPMCategoryId { get; set; }

    /// <summary>
    /// 品牌
    /// </summary>
    public Guid? Brand { get; set; }

    /// <summary>
    /// 型号
    /// </summary>
    [MaxLength(50)]
    public string? Model { get; set; }

    /// <summary>
    /// 供应商名称
    /// </summary>
    [MaxLength(100)]
    public string? Supplier { get; set; }

    /// <summary>
    /// 单位
    /// </summary>
    public Guid Unit { get; set; }

    /// <summary>
    /// 参考单价
    /// </summary>
    public decimal? Price { get; set; }

    /// <summary>
    /// 最低库存
    /// </summary>
    public int? LowNum { get; set; }

    /// <summary>
    /// 最高库存
    /// </summary>
    public int? MaxNum { get; set; }

    /// <summary>
    /// 使用周期
    /// </summary>
    public decimal? UseCycle { get; set; }

    /// <summary>
    /// 采购周期
    /// </summary>
    public decimal? ProcurementCycle { get; set; }

    /// <summary>
    /// 图片
    /// </summary>
    public string Picture { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }

    /// <summary>
    /// SAP创建时间
    /// </summary>
    public DateTime? CreateTimeInSAP { get; set; }

    /// <summary>
    /// SAP更新时间
    /// </summary>
    public DateTime? UpdateTimeInSAP { get; set; }

    /// <summary>
    /// SAP同步时间
    /// </summary>
    public DateTime? SyncTime { get; set; }

    /// <summary>
    /// 创建人
    /// </summary>
    [MaxLength(20)]
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 修改人
    /// </summary>
    [MaxLength(20)]
    public string? UpdateUser { get; set; }

    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 子表：非采物料参数
    /// </summary>
    public List<PartsParas> PartsParases { get; set; }//一对多
}

/// <summary>
/// 删除参数
/// </summary>
public class DeletePartsInput
{
    /// <summary>
    /// </summary>
    public Guid Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomePartsInput
{
    /// <summary>
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    public string? PartNo { get; set; }  //唯一索引

    /// <summary>
    /// 状态
    /// </summary>
    public int? Status { get; set; }
}